<?php
/**
 *  获取体征时间段配置 模型
 * @authors xiadx (xiadx@zpdchina.com)
 * @date    2017-03-06 14:04:16
 * @version $Id$
 */

class DataTizhengShijianPeizhiModel extends BaseModel {
    /**
     * 返回给终端的可执行sql语句的字段名称数组
     * @var [type]
     */
    public $_field_arr = ['id','begin_time','end_time','time_desc'];

    public function ls($user_department='')
    {
    	$field_str = implode(',', $this->_field_arr);
    	$query = DB::select($field_str)
    				->from('data_tizheng_shijian_peizhi')
    				->where('yiyuan_id', '=', $this->yiyuan_id)
    				->and_where('`state`', '=', 1)
    				->and_where_open()
    					->where('keshi', '=', $user_department)
    					->or_where('keshi', '=', '通用')
    				->and_where_close()
                    ->execute()
                    ->as_array();
		return $query;
    }
}
